package com.itheima.Demo01.demo02;

import java.util.ArrayList;

public class Genericity {
    public static void main(String[] args) {
        ArrayList<String> method = method(new ArrayList<String>(), "ab", "a", "a", "a", "a");
        System.out.println(method);

        ArrayList<Character> method1 = method(new ArrayList<Character>(), 'a', 'Q', 'W', 'E', 'R');
        for (int i = 0; i < method1.size(); i++) {
            char[] chars0 = method1.get(i).toChars(method1.get(i));
            System.out.println("CHAR:" + chars0[i]);
            break ;
        }
        System.out.println(method1);
    }

    public static <T> ArrayList<T> method(ArrayList<T> list, T T1, T T2, T T3, T T4, T T5) {
        list.add(T1);
        list.add(T2);
        list.add(T3);
        list.add(T4);
        list.add(T5);
        return list;
    }
}
